package SpringEl;

import com.sun.javafx.runtime.SystemProperties;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * Created by ztt on 2017/9/21.
 */
@Component
public class UserService {

    @Value("#{T(System).currentTimeMillis()}")
    private long time;

    public UserService(){
        System.out.println("time:"+time);
    }

    public long getTime() {
        return time;
    }

    public void setTime(long time) {
        this.time = time;
    }

    public UserService(@Value("#{systemProperties[user.name]}")String name){
        System.out.printf("name:%s",name);
        System.out.println();

    }
}
